function [theta,theta_deg] = find_Theta(U_s,I_s,U_p,cos_phi,X_d,X_q,R_s)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here

phi = acos(cos_phi);
sin_phi = -sin(phi);

A=[U_s*cos_phi-R_s*I_s , U_s*sin_phi-X_d*I_s;
   U_s*sin_phi+X_q*I_s , U_s*cos_phi-R_s*I_s];
b=[U_p;0]

[theta]=A\b

acos(theta(1))*180/pi
asin(theta(2))*180/pi

theta=1;
theta_deg=1;

end

